//package com.solome.ui;
//
//import com.badlogic.gdx.graphics.Color;
//import com.badlogic.gdx.graphics.Texture.TextureFilter;
//import com.badlogic.gdx.graphics.g2d.Batch;
//import com.badlogic.gdx.graphics.g2d.BitmapFont;
//import com.badlogic.gdx.graphics.g2d.TextureRegion;
//import com.badlogic.gdx.scenes.scene2d.ui.Widget;
//import com.badlogic.gdx.utils.Align;
//import com.badlogic.gdx.utils.Array;
//import com.badlogic.gdx.utils.Disposable;
//import com.solome.util.FontFactoryOld;
//
//public class SoLableTTFOld extends Widget implements Disposable {
//	private int fontSize;
//	private String font;
//	private boolean isWrapped;
//	private float fontScale;
//
//	public SoLableTTFOld(CharSequence font, int fontSize, Color color) {
//		// TODO Auto-generated constructor stub
//		this.fontSize = fontSize;
//		this.setColor(color);
//		this.font = font.toString();
//		FontFactoryOld.getInstance().getBitmapFont(font, fontSize, Color.WHITE);
//	}
//
//	@Override
//	public void draw(Batch batch, float parentAlpha) {
//		// TODO Auto-generated method stub
//		BitmapFont bitmapFont = getBitmapFont();
//		if (bitmapFont == null) {
//			this.getParent().removeActor(this);
//			return;
//		}
//		Array<TextureRegion> regions = bitmapFont.getRegions();
//		for (TextureRegion textureRegion : regions) {
//			textureRegion.getTexture().setFilter(TextureFilter.Linear,
//					TextureFilter.Linear);
//		}
//		super.draw(batch, parentAlpha);
//		bitmapFont.getCache().setColor(this.getColor());
//		if (isWrapped)
//			bitmapFont.draw(batch, this.font, getX(), getY());
//		else
//			bitmapFont.draw(batch, this.font, getX(), getY(), 640,
//					Align.center, true);
//	}
//
//	public BitmapFont getBitmapFont() {
//		return FontFactoryOld.getInstance().getBitmapFont("" + this.fontSize);
//	}
//
//	public String getFont() {
//		return font;
//	}
//
//	public void setFont(String font) {
//		this.font = font;
//	}
//
//	public boolean isWrapped() {
//		return isWrapped;
//	}
//
//	public void setWrapped(boolean isWrapped) {
//		this.isWrapped = isWrapped;
//	}
//
//	@Override
//	public void dispose() {
//		// TODO Auto-generated method stub
//	}
//
//	public float getFontScale() {
//		return fontScale;
//	}
//
//	public void setFontScale(float scale) {
//		this.fontScale = scale;
//	}
//}
//
////
//// import com.badlogic.gdx.graphics.Color;
//// import com.badlogic.gdx.graphics.g2d.Batch;
//// import com.badlogic.gdx.graphics.g2d.BitmapFont;
//// import com.badlogic.gdx.scenes.scene2d.ui.Label;
//// import com.solome.util.FontFactory;
////
//// public class SoLableTTF extends Label {
//// private int fontSize;
//// private Color color;
//// private String font;
////
//// public SoLableTTF(CharSequence font, int fontSize, Color color) {
//// super(font, getStyle("SoLableTTF", font, fontSize, color));
//// // TODO Auto-generated constructor stub
//// this.fontSize = fontSize;
//// this.color = color;
//// this.font = font.toString();
//// }
////
//// public SoLableTTF(CharSequence font, LabelStyle style) {
//// // TODO Auto-generated constructor stub
//// super(font, style);
//// }
////
//// private static LabelStyle getStyle(String objectName, CharSequence font,
//// int fontSize, Color color) {
//// BitmapFont bitmapFont = FontFactory.getInstance().getBitmapFont(
//// objectName, font, fontSize, color);
//// LabelStyle labelStyle = new LabelStyle(bitmapFont, color);
//// return labelStyle;
//// }
////
//// public void setFont(CharSequence font) {
//// if (font.toString().equals(this.font)) {
//// return;
//// }
//// // if (!FontFactoryCache.getInstance().include(font.toString(),
//// // this.font)) {
//// this.font = font.toString();
//// refresh();
//// // }
//// this.setText(font);
//// }
////
//// public void setSize(int fontSize) {
//// if (fontSize != this.fontSize) {
//// this.fontSize = fontSize;
//// refresh();
//// }
//// }
////
//// public void setColor(Color color) {
//// if (this.color.r != color.r || this.color.g != color.g
//// || this.color.b != color.b || this.color.a != color.a) {
//// this.color = color;
//// refresh();
//// // System.err.println("....setFontColor...........");
//// // this.getBitmapFontCache().setColor(this.color);
//// }
//// }
////
//// @Override
//// public void draw(Batch batch, float parentAlpha) {
//// // TODO Auto-generated method stub
//// String key = this.getClass().getSimpleName() + "_" + fontSize
//// + color.toString();
////
////
//// super.draw(batch, parentAlpha);
//// }
////
//// // @Override
//// // public void draw(Batch batch, float parentAlpha) {
//// // // TODO Auto-generated method stub
//// // // super.draw(batch, parentAlpha);
//// // validate();
//// // Color color = get.set(getColor());
//// // color.a *= parentAlpha;
//// // if (style.background != null) {
//// // batch.setColor(color.r, color.g, color.b, color.a);
//// // style.background.draw(batch, getX(), getY(), getWidth(),
//// // getHeight());
//// // }
//// // if (style.fontColor != null)
//// // color.mul(style.fontColor);
//// // cache.tint(color);
//// // cache.setPosition(getX(), getY());
//// // cache.draw(batch);
//// // }
////
//// private void refresh() {
//// try {
//// this.getBitmapFontCache().getFont().dispose();
//// LabelStyle labelStyle = getStyle("SoLableTTF", this.font,
//// this.fontSize, this.color);
//// this.setStyle(labelStyle);
//// } catch (Exception e) {
//// throw new IllegalArgumentException(
//// "labelStyle IllegalArgumentException.");
//// }
//// }
// // }
